From 097dd20cb3103bb0de9b10c2795eba6b228d5f5d Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 15 Jan 2004 11:31:37 +0000 Subject: [PATCH] (Freplace_match): Use make_multibyte_string or make_unibyte_string according to the buffer multibyteness. --- src/search.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/search.c b/src/search.c index 538cb8dfa64..020573b75a1 100644 --- a/src/search.c +++ b/src/search.c @@ -2553,8 +2553,16 @@ since only regular expressions have distinguished subexpressions. */) } if (really_changed) - newtext = make_string (substed, substed_len); + { + if (buf_multibyte) + { + int nchars = multibyte_chars_in_text (substed, substed_len); + newtext = make_multibyte_string (substed, nchars, substed_len); + } + else + newtext = make_unibyte_string (substed, substed_len); + } xfree (substed); } -- 2.30.2